﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;

namespace Smolder.Model
{
    public class Session : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
        public bool IsAuthorized
        {
            get { return _isAuthorized; }
            set
            {
                if (_isAuthorized == value) return;
                _isAuthorized = value;
                NotifyPropertyChanged("IsAuthorized");
            }
        }

        private bool _isAuthorized;

        public void NotifyPropertyChanged(string propertyName) 
        {
            if (PropertyChanged == null) return;
            PropertyChanged(this,new PropertyChangedEventArgs(propertyName));
        }
    }

    //public class UneAutreClasse {
    //    public void run() {
    //        Session s = new Session();
    //        //s.PropertyChanged+=OnPropertyChanged;
    //        s.PropertyChanged += (sender, e) =>
    //        {
    //            checkBoxIsAuthorized.Enabled = s.IsAuthorized;
    //        };
    //    }

    //    //public void OnPropertyChanged(object sender, PropertyChangedEventArgs e) { 

    //    //} 
    //}
}
